#ifndef ACCEPTOR_H
#define ACCEPTOR_H

#include "event_handler.h"
#include "tcp_socket.h"
#include "network.h"
#include "singletone.h"
#include "thread_container.h"
#include "configurator.h"
#include "receiver.h"
#include "multicaster.h"
#include "handler/music_handler.h"

#include <boost/shared_ptr.hpp>

namespace network {
	class acceptor : public network::event_handler {
	public:
		acceptor(boost::shared_ptr<network::tcp_socket> sock,
			 boost::shared_ptr<network::thread_container> con,
			 boost::shared_ptr<network::message_queue> msg,
			 boost::shared_ptr<network::multicaster> mul)
		:_sock(sock), _cont(con), _queue(msg), _multi(mul) {}
		virtual ~acceptor() {}
		virtual network::event_type get_type() const
		{
			return network::CONNECT;
		}
		virtual boost::shared_ptr<const network::i_socket>
			get_socket() const {return _sock;}
		virtual void handle_event(
			boost::shared_ptr<network::event> n);
	private:
		boost::shared_ptr<network::tcp_socket> _sock;
		boost::shared_ptr<network::thread_container> _cont;
		boost::shared_ptr<network::message_queue> _queue;
		boost::shared_ptr<network::multicaster> _multi;
	};
}

#endif
